var formatDate = function(dates) {
  var ymd = ''
  if (dates === null || dates === '' || dates === '0000-00-00 00:00:00') {
    ymd = ''
  } else {
    var date = new Date(dates)
    var y = date.getFullYear()
    var m = date.getMonth() + 1
    m = m < 10 ? '0' + m : m
    var d = date.getDate()
    d = d < 10 ? ('0' + d) : d
    ymd = y + '-' + m + '-' + d
  }
  return ymd
}
export default formatDate
